import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
// 引入全局css
import './assets/global.css'

// 引入字体图标
import './assets/fonts/iconfont.css'

// 配置axios
import axios from 'axios'

// 设置请求根域名
axios.defaults.baseURL = 'http://115.159.87.220:8888/api/private/v1/'

// 挂载路由
Vue.prototype.$axios = axios
Vue.config.productionTip = false

// 发请求 token验证
axios.interceptors.request.use(config => {
  config.headers.Authorization = sessionStorage.getItem('token')
  return config
})

// 请求加载完成触发
axios.interceptors.response.use(res => {
  return res
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
